<?php 
session_start();
?>
<html>
    <head>
        <link rel="stylesheet" href="style/style.css" />
        <script type="text/javascript" src="script/ajax.js"></script>
    </head>
    <body>
    <div id="headerBody">
        <form id="Search" name="Search" method ="GET" action="search_result.php">

            <input type="text" id="SearchBar" name="SearchBar"/>

            <input type="submit" id="SearchOk" name="SearchOk" value="Search"/>
        </form>
        <?php if($_SESSION['Username'] != null) {
		?>
        <a id="headerLink" href="home.php" id="headerLink">Home</a>
                    <a id="headerLink" href="profile.php" id="headerLink">Profile</a>
                    <a id="headerLink" href="message.php" id="headerLink">Message</a>
                    <a id="headerLink" href="uploader.php" id="headerLink">Uploader</a>
                    <a id="headerLink" href="gallery.php" id="headerLink">Gallery</a>
        <a href="database/login.php?logout=1" id="logout_link" >Logout</a>
        <a href="javascript:showNotif('<?php echo $_SESSION['Username']; ?>');" id="headerLink">Notification</a>
        <!-- tampilin jumlah notif -->
        <?php
            require_once 'database/notif_handler.php';

            $notif = new notif_handler();
            $jml = 0;
            
            $notif->retr_notification($_SESSION['Username']);
            if (count($notif->berita) > 0 && $notif->berita[0] != null) {
                for ($i=0; $i<count($notif->berita); $i++){
                    if ($notif->read[$i] == 0){
                        $jml++;
                    }
                }
                if ($jml > 0) echo "<font color='red'>(". $jml. ")</font>";
            }
            else{
                echo "";
            }
        ?>
        <div id="notif">
            <div id="notif2">
            </div>
        </div>
        <a href="profile.php" id="logout_link" ><?php echo $u;?></a>
		<?php } else {
		?>
			<a href="index.php" id="logout_link" >Login</a>
            <?php
		}
		?>
    </div>
        <div id=""><img src="images/flickertiew_logo.gif" alt=""/></div>
    </body>
</html>